<template>
  <div class="privilege">
    <el-table :data="tableData">
      <el-table-column label="序号" type="index" />
      <el-table-column label="权限字段" prop="url" />
      <el-table-column label="权限名称" prop="name" />
    </el-table>
  </div>
</template>

<script>
import { getPrivilegeList } from '@/api/privilege'

export default {
  name: 'Privilege',
  data() {
    return {
      tableData: [],
      userId: ''
    }
  },
  mounted() {
    this.getList()
    this.userId = localStorage.getItem('userid')
    console.log(this.userId)
  },
  methods: {
    getList() {
      getPrivilegeList({ userId: localStorage.getItem('userid') }).then(res => {
        this.tableData = res.data
      })
    }
  }
}
</script>

<style scoped>
</style>
